// let matrix1=[[1,2],[2,4]];
// let matrix2=[[2,3],[5,2]];

// let matrix1=[[1,2,3]];
// let matrix2=[[2],[5],[4]];

let matrix1=[[2],[5],[4]];
let matrix2=[[1,2,3]];


function multiply(matrix1,matrix2){
    let _matrix1=[];
    for (let i = 0; i < matrix1.length; i++) {
        let _matrix2=[];
        for (let j = 0; j < matrix2[0].length; j++) {
            let num = 0; 
            for (let k = 0; k < matrix1[i].length; k++) {
                num+=matrix1[i][k]*matrix2[k][j];
                // console.log(matrix1[i][k]*matrix2[k][j]);
            }
            _matrix2.push(num);
            // console.log(num);
        }
        _matrix1.push(_matrix2);
    }
    console.log(_matrix1)
}

multiply(matrix1,matrix2);